package org.jeecg.modules.ywMaterialEnter.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.constant.CommonConstant;
import org.jeecg.modules.ywMaterialEnter.entity.YwMaterialEnterDetail;
import org.jeecg.modules.ywMaterialEnter.mapper.YwMaterialEnterDetailMapper;
import org.jeecg.modules.ywMaterialEnter.service.IYwMaterialEnterDetailService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: 材料入库-详情
 * @Author: jeecg-boot
 * @Date: 2024-08-22
 * @Version: V1.0
 */
@Service
public class YwMaterialEnterDetailServiceImpl extends ServiceImpl<YwMaterialEnterDetailMapper, YwMaterialEnterDetail> implements IYwMaterialEnterDetailService {

    @Resource
    private YwMaterialEnterDetailMapper ywMaterialEnterDetailMapper;

    @Override
    public List<YwMaterialEnterDetail> selectByMainId(String mainId) {
        return ywMaterialEnterDetailMapper.selectByMainId(mainId);
    }

    @Override
    public List<YwMaterialEnterDetail> selectList(String id) {
        QueryWrapper<YwMaterialEnterDetail> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("enter_id", id);
        queryWrapper.eq("status", CommonConstant.StatusEnum.YES.getCode());
        return this.ywMaterialEnterDetailMapper.selectList(queryWrapper);
    }

}
